﻿using DJ.Clients;
using DJ.ZEF.ThirdParty;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;
using System.Windows.Threading;

namespace DJ.Dialog
{
    /// <summary>
    /// ContinueView.xaml 的交互逻辑
    /// </summary>
    public partial class ContinueView : Window
    {
        DispatcherTimer timer = new DispatcherTimer();
        public ContinueView()
        {
            InitializeComponent();
            timer.Interval = new TimeSpan(0, 0, 1);
            timer.Tick += ((a, b) =>
            {
                Label1.Tag = Label1.Tag.ToInt32()-1;
                if (Label1.Tag.ToInt32() <= 0)
                {
                    this.Close();
                    return;
                }
                Label1.Content = Label1.Tag + "s";
                
            });
            timer.IsEnabled = true;
            timer.Start();
        }


        private void Button_Yes(object sender, RoutedEventArgs e)
        {
            DialogResult = true;
        }

        private void Button_No(object sender, RoutedEventArgs e)
        {
            DialogResult = false;
        }
    }
}
